home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 001.dms / 001.adf / source / MagnumProSource.ASCII < prev    next >
Text File  |  1978-01-05  |  17KB  |  593 lines

  1. ' This source may not be resold, redistributed, or disfigured for release
  2. ' in any way, it is copyright material.  Offenders will be found!
  3. '
  4. ' The source is part of the MAGNUM PRO package available only from 
  5. ' the F1 Licenceware range.  If you have obtained this through other 
  6. ' means you are advised to delete this copy and purchase the original: 
  7. ' copies can be changed and could carry viruses and damage your Amiga! 
  8. '
  9. ' Considering the low price, there is no excuse for piracy.
  10. '
  11. ' (5.2.94) 
  12. '
  13. '
  14. ' *** Setup some amos system flags 
  15. ' *** Remove AMOS LOCK to enable Amiga-A multi-tasking 
  16. Set Buffer 40
  17. '
  18. '
  19. Amos Lock 
  20. Break Off 
  21. Track Loop On 
  22. Hide 
  23. '
  24. '
  25. ' *** Set up the panel gfx by loading it and packing it
  26. '
  27. Load Iff "magnum.panel",0
  28. Screen Hide 0 : Spack 0 To 5 : Screen Close 0
  29. '
  30. '
  31. ' *** Load up music, bug in TRACK LOAD extension, needs path tagged on 
  32. '
  33. ' MON 1/0 ... music on/off 
  34. ' MUZAK ... tracker music present  
  35. If Exist("magnum.music")=-1
  36.    BUG$=Dir$
  37.    Track Load BUG$+"magnum.music",3 : Led Off : MON=1 : MUZAK=True : Track Play 
  38. End If 
  39. '
  40. '
  41. ' *** bad loop to load title pics
  42. '
  43. If Exist("magnum.t1")=-1 Then A$="magnum.t1" : Gosub _SHOWPIC
  44. If Exist("magnum.t2")=-1 Then A$="magnum.t2" : Gosub _SHOWPIC
  45. If Exist("magnum.t3")=-1 Then A$="magnum.t3" : Gosub _SHOWPIC
  46. If Exist("magnum.t4")=-1 Then A$="magnum.t4" : Gosub _SHOWPIC
  47. If Exist("magnum.t5")=-1 Then A$="magnum.t5" : Gosub _SHOWPIC
  48. Goto FIN_INTRO
  49. ' *** subroutine to fade intro pictures in and out 
  50. _SHOWPIC:
  51. Load Iff A$,0 : Screen Hide 0
  52. GW=Screen Colour : Screen Open 1,100,10,GW,Lowres
  53. Screen Hide 1 : Flash Off : Curs Off 
  54. Get Palette 0
  55. Screen 0 : Fade 1 : Wait 15
  56. Screen Show 0 : Fade 3 To 1 : Wait 45 : Screen Close 1
  57. Wait 220 : Fade 2 : Wait 30 : Screen Close 0
  58. Return 
  59. FIN_INTRO:
  60. '
  61. '
  62. '
  63. ' -----------------------------------------------------------------------
  64. '              Define (global) variables for ascii reader
  65. ' -----------------------------------------------------------------------
  66. Dim ITEM$(500),BOOT$(500),RGB$(4)
  67. Dim PAGESTART(200),PAGEEND(200),PAGE_PEN(200)
  68. Global CURRENT_PAGE,PAGE_NUM,INDXL,ITEM$(),BOOT$(),TITLE$,RGB$(),POSITION2,NUM
  69. Global FILE_LENGTH,PAGESTART(),PAGEEND(),PAGE_LENGTH,FILE_PRESENT
  70. Global NO_INDEX,CUR_INDEX,PICCY,CUR_PEN,PAGE_PEN(),TXTFADE
  71. FILE_PRESENT=False
  72. CURRENT_PAGE=0
  73. PAGE_LENGTH=24
  74. CUR_INDEX=0
  75. NO_INDEX=1 : Rem 1 page as default
  76. CUR_PEN=1
  77. '
  78. '
  79. ' -----------------------------------------------------------------------
  80. MAKE_INDEX : SET_UP_SCREENS : Change Mouse 4 : Show : Screen 2
  81. '
  82. ' Loops are here, complicated!  Spaghetti junction...
  83. '
  84. Repeat 
  85.    Do 
  86.       '==========================================================================
  87.       Screen 1
  88.       POSITION1=Mouse Zone
  89.       Screen 2
  90.       '==========================================================================
  91.       If FILE_PRESENT=0 and PICCY=0
  92.          POSER=Mouse Zone
  93.          POSITION2=POSER+(CUR_INDEX*20)
  94.          If POSER and(POSER<>OLD)
  95.             If Left$(BOOT$(POSITION2-9),7)<>"*empty*"
  96.                Locate 0,POSER-6
  97.                Inverse On : Centre ITEM$(POSITION2-9)
  98.             End If 
  99.             If OLD
  100.                Locate 0,OLD-6
  101.                Inverse Off : Centre ITEM$(OLDEN-9)
  102.             End If 
  103.             OLD=POSER
  104.             OLDEN=POSITION2
  105.          End If 
  106.          If POSER=0 and OLD<>0
  107.             Inverse Off 
  108.             Locate 0,OLD-6
  109.             Centre ITEM$(OLDEN-9)
  110.             OLD=0
  111.             OLDEN=0
  112.          End If 
  113.          Inverse Off 
  114.       End If 
  115.       '==========================================================================
  116.       Screen 1
  117.       KEYS$=Inkey$
  118.       If KEYS$<>"" Then Exit 
  119.       Exit If Mouse Click
  120.    Loop 
  121.    '==========================================================================
  122.    If PICCY
  123.       If POSITION1=1 or Key State(69)
  124.          Screen Close 2 : OPEN_HIRES : SET_UP_INDEX : PICCY=0 : POSITION2=0 : OLD=0
  125.          Limit Mouse X Hard(0),Y Hard(0) To X Hard(640),Y Hard(256)
  126.       End If 
  127.       If(KEYS$="" and POSITION1=2) or(Upper$(KEYS$)="S")
  128.          If MUZAK=True
  129.             If MON=1
  130.                MON=0 : Track Stop 
  131.             Else 
  132.                MON=1 : Track Play 
  133.             End If 
  134.          End If 
  135.       End If 
  136.       If POSITION1=6 or((Key Shift=1 or Key Shift=2) and Key State(69))
  137.          End 
  138.       End If 
  139.       Goto ZZTOP
  140.    End If 
  141.    '==========================================================================
  142.    If(KEYS$="" and POSITION1=2) or(Upper$(KEYS$)="S")
  143.       If MUZAK=True
  144.          If MON=1
  145.             MON=0 : Track Stop 
  146.          Else 
  147.             MON=1 : Track Play 
  148.          End If 
  149.       End If 
  150.    End If 
  151.    '  ^- Sound on/off zone
  152.    If((Key Shift=1 or Key Shift=2) and Key State(69))
  153.       End 
  154.    End If 
  155.    '  ^- Quit by SHIFT+ESCAPE 
  156.    If Key State(69) and FILE_PRESENT Then SET_UP_INDEX : POSITION2=0 : OLD=0 : FILE_PRESENT=0
  157.    '  ^- Reset INDEX
  158.    '==========================================================================
  159.    If KEYS$="" Then Goto CHECK_D_ZONES
  160.    If KEYS$=Chr$(28) and FILE_PRESENT Then PAGE_DOWN
  161.    If KEYS$=Chr$(29) and FILE_PRESENT Then PAGE_UP
  162.    If KEYS$=Chr$(30) and FILE_PRESENT Then PAGE_SHOW[0]
  163.    If KEYS$=Chr$(31) and FILE_PRESENT Then PAGE_SHOW[PAGE_NUM-1]
  164.    If KEYS$=Chr$(32) and FILE_PRESENT Then CHOOSE_PAGE
  165.    If KEYS$=Chr$(69) and FILE_PRESENT Then SET_UP_INDEX : POSITION2=0 : OLD=0 : FILE_PRESENT=0
  166.    If KEYS$=Chr$(30) and FILE_PRESENT=0 Then CUR_INDEX=0 : SET_UP_INDEX : POSITION2=0 : OLD=0
  167.    If KEYS$=Chr$(31) and FILE_PRESENT=0 Then CUR_INDEX=NO_INDEX-1 : SET_UP_INDEX : POSITION2=0 : OLD=0
  168.    If KEYS$=Chr$(32) and FILE_PRESENT=0 Then CHOOSE_INDEX : POSITION2=0 : OLD=0
  169.    If KEYS$=Chr$(29) and FILE_PRESENT=0 Then INDEX_UP : POSITION2=0 : OLD=0
  170.    If KEYS$=Chr$(28) and FILE_PRESENT=0 Then INDEX_DOWN : POSITION2=0 : OLD=0
  171.    If POSITION2 and FILE_PRESENT=0 and(KEYS$=Chr$(13)) Then FILE_LOADER[BOOT$(POSITION2-9)]
  172.    Goto ZZTOP
  173.    '==========================================================================
  174.    CHECK_D_ZONES:
  175.    If POSITION1=1 and FILE_PRESENT Then SET_UP_INDEX : POSITION2=0 : OLD=0 : FILE_PRESENT=0
  176.    If POSITION1=3 and FILE_PRESENT Then PAGE_SHOW[0]
  177.    If POSITION1=4 and FILE_PRESENT Then PAGE_SHOW[PAGE_NUM-1]
  178.    If POSITION1=5 and FILE_PRESENT Then CHOOSE_PAGE
  179.    If POSITION1=9 and FILE_PRESENT Then PAGE_SHOW[0]
  180.    If POSITION1=10 and FILE_PRESENT Then PAGE_SHOW[PAGE_NUM-1]
  181.    If POSITION1=6 Then FINISH
  182.    If POSITION1=7 and FILE_PRESENT Then PAGE_UP
  183.    If POSITION1=8 and FILE_PRESENT Then PAGE_DOWN
  184.    If POSITION1=3 and FILE_PRESENT=0 Then CUR_INDEX=0 : SET_UP_INDEX : POSITION2=0 : OLD=0
  185.    If POSITION1=4 and FILE_PRESENT=0 Then CUR_INDEX=NO_INDEX-1 : SET_UP_INDEX : POSITION2=0 : OLD=0
  186.    If POSITION1=5 and FILE_PRESENT=0 Then CHOOSE_INDEX : POSITION2=0 : OLD=0
  187.    If POSITION1=7 and FILE_PRESENT=0 Then INDEX_UP : POSITION2=0 : OLD=0
  188.    If POSITION1=8 and FILE_PRESENT=0 Then INDEX_DOWN : POSITION2=0 : OLD=0
  189.    If POSITION1=9 and FILE_PRESENT=0 Then CUR_INDEX=0 : SET_UP_INDEX : POSITION2=0 : OLD=0
  190.    If POSITION1=10 and FILE_PRESENT=0 Then CUR_INDEX=NO_INDEX-1 : SET_UP_INDEX : POSITION2=0 : OLD=0
  191.    If POSITION2 and FILE_PRESENT=0 Then FILE_LOADER[BOOT$(POSITION2-9)]
  192.    '==========================================================================
  193.    ZZTOP:
  194.    POSER=0
  195.    POSITION1=0
  196.    KEYS$=""
  197.    Clear Key 
  198.    If PICCY
  199.       Screen 0 : Cls 0 : Home : Print ITEM$(POSITION2-9);
  200.       X$="Page 1 of 1" : Locate 79-Len(X$),0 : Print X$;
  201.    End If 
  202.    '==========================================================================
  203. Until False
  204. '
  205. '
  206. '
  207. '
  208. ' -----------------------------------------------------------------------
  209. '                           Procedures are here
  210. ' -----------------------------------------------------------------------
  211. Procedure FINISH
  212.    Timer=0
  213.    Repeat 
  214.       If Mouse Click and Mouse Zone=6 Then End 
  215.    Until Timer>45
  216. End Proc
  217. ' -----------------------------------------------------------------------
  218. Procedure PAGE_UP
  219.    If CURRENT_PAGE>0
  220.       Dec CURRENT_PAGE
  221.       PAGE_SHOW[CURRENT_PAGE]
  222.    End If 
  223. End Proc
  224. ' -----------------------------------------------------------------------
  225. Procedure PAGE_DOWN
  226.    If CURRENT_PAGE<PAGE_NUM-1
  227.       Inc CURRENT_PAGE
  228.       PAGE_SHOW[CURRENT_PAGE]
  229.    End If 
  230. End Proc
  231. ' -----------------------------------------------------------------------
  232. Procedure INDEX_UP
  233.    If CUR_INDEX>0
  234.       Dec CUR_INDEX
  235.       SET_UP_INDEX
  236.    End If 
  237. End Proc
  238. ' -----------------------------------------------------------------------
  239. Procedure INDEX_DOWN
  240.    If CUR_INDEX<NO_INDEX-1
  241.       Inc CUR_INDEX
  242.       SET_UP_INDEX
  243.    End If 
  244. End Proc
  245. ' -----------------------------------------------------------------------
  246. Procedure FILE_LOADER[F$]
  247.    TEMP=0
  248.    On Error Goto FATEL_ERROR4
  249.    If Left$(F$,7)="*empty*" Then Goto RECOVER_4
  250.    If Left$(F$,5)<>"*iff*" Then Goto TESTLOAD2
  251.    F$=F$-"*iff*"
  252.    Open In 1,F$
  253.    FILE_LENGTH=Lof(1)
  254.    Close 1
  255.    Erase 10
  256.    If Chip Free+Fast Free>FILE_LENGTH+1024
  257.       Load Iff F$,2
  258.       Screen Display 2,,56,,200
  259.       PICCY=True
  260.    End If 
  261.    Goto RECOVER_4
  262.    '
  263.    TESTLOAD2:
  264.    If Left$(F$,7)<>"*music*" Then Goto TXT
  265.    F$=F$-"*music*"
  266.    If Exist(F$)=-1
  267.       Track Stop : Erase 3 : Track Load F$,3 : Track Play 
  268.       MUZAK=1
  269.    End If 
  270.    Goto RECOVER_4
  271.    '
  272.    TXT:
  273.    Open In 1,F$
  274.    FILE_LENGTH=Lof(1)
  275.    Close 1
  276.    Erase 10
  277.    If Chip Free+Fast Free>FILE_LENGTH+1024
  278.       Reserve As Work 10,FILE_LENGTH
  279.       Bload F$,10
  280.       FILE_PROCESS
  281.       FILE_PRESENT=True
  282.    End If 
  283.    RECOVER_4:
  284.    Close 
  285.    Pop Proc
  286.    FATEL_ERROR4:
  287.    TEMP=1
  288.    Resume RECOVER_4
  289. End Proc[TEMP]
  290. ' -----------------------------------------------------------------------
  291. Procedure SET_UP_SCREENS
  292.    OPEN_HIRES
  293.    OPEN_TELETEXT
  294.    Unpack 5 To 1 : Erase 5
  295.    Screen Display 1,,259,,
  296.    Restore POSITION_OF_ZONES
  297.    Reserve Zone 10
  298.    For LOP=1 To 8
  299.       Read X1,X2
  300.       If LOP<7
  301.          Set Zone LOP,X1,6 To X2,33
  302.       Else 
  303.          Set Zone LOP,X1,14 To X2,24
  304.       End If 
  305.    Next LOP
  306.    Set Zone 9,295,4 To 306,14
  307.    Set Zone 10,295,24 To 306,34
  308.    Screen 0
  309.    Limit Mouse X Hard(0),Y Hard(0) To X Hard(640),Y Hard(256)
  310.    SET_UP_INDEX
  311.    For I=0 To 2
  312.       Screen I
  313.       Colour 18,Val("$"+RGB$(2))
  314.       Colour 19,Val("$"+RGB$(3))
  315.    Next I
  316.    POSITION_OF_ZONES:
  317.    Data 5,48,52,93,97,138,142,183,187,228,232,274,285,294,307,316
  318. End Proc
  319. '
  320. ' By writing an editor or just changing the zone sizes etc. and the panel you
  321. ' can create a much better user interface.  Originally I styled it on
  322. ' GrapeVine (Hi LSD!) which led to some people thinking GV was coded with
  323. ' Magnum...  It wasn't but if it was I would be wanting royalty payments off 
  324. ' LSD at this stage! 
  325. ' -----------------------------------------------------------------------
  326. Procedure OPEN_HIRES
  327.    Screen Open 2,640,200,8,Hires
  328.    Screen Hide 2
  329.    Screen Display 2,,56,,
  330.    Curs Off : Flash Off : Cls 0
  331.    Palette $0,$EEE,$C00,$CC0,$C0,$CC,$C,$C0C
  332.    Paper 0
  333.    If PICCY
  334.       Colour 18,Val("$"+RGB$(2))
  335.       Colour 19,Val("$"+RGB$(3))
  336.    End If 
  337.    Screen Show 2
  338. End Proc
  339. ' -----------------------------------------------------------------------
  340. Procedure OPEN_TELETEXT
  341.    Screen Open 0,640,9,2,Hires
  342.    Screen Hide 0
  343.    Screen Display 0,,44,,
  344.    Curs Off 
  345.    Colour 0,Val("$"+RGB$(0))
  346.    Colour 1,Val("$"+RGB$(1))
  347.    Paper 0
  348.    Pen 1
  349.    Set Curs 255,255,255,255,255,255,255,255
  350.    Screen Show 0
  351. End Proc
  352. ' -----------------------------------------------------------------------
  353. Procedure SET_UP_INDEX
  354.    Screen 0 : Cls 0 : Home 
  355.    Pen 1
  356.    Print "Index";
  357.    X$="Page"+Str$(CUR_INDEX+1)+" of"+Str$(NO_INDEX)
  358.    Locate 79-Len(X$),0 : Print X$;
  359.    '
  360.    Screen 2 : Palette 0,0,0,0,0,0,0,0 : Cls 0
  361.    Pen 1 : Home : Print TITLE$
  362.    Zoom 2,0,0,240,8 To 2,0,8,640,16
  363.    Pen 0 : Home : Print TITLE$ : Cdown : Cdown : Pen 1
  364.    '
  365.    ' This creates the larger text by stretching it
  366.    '
  367.    STA=CUR_INDEX*20
  368.    If NO_INDEX>CUR_INDEX+1
  369.       FIN=STA+19
  370.    Else 
  371.       FIN=INDXL-1
  372.       Q=FIN-STA
  373.       If Q>19
  374.          Q=Q-19
  375.          FIN=FIN-Q
  376.       End If 
  377.    End If 
  378.    '
  379.    Reserve Zone 28
  380.    Z=0
  381.    For I=STA To FIN
  382.       If ITEM$(I)<>""
  383.          If ITEM$(I)<>"*empty*"
  384.             Centre Zone$(ITEM$(I),Z+9)
  385.          End If 
  386.       End If 
  387.       Inc Z
  388.       Cdown 
  389.    Next I
  390.    Fade 1,0,$EEE,$C00,$CC0,$C0,$CC,$C,$C0C
  391.    Wait 15
  392.    TXTFADE=0 : Rem Turn off textfading
  393. End Proc
  394. ' -----------------------------------------------------------------------
  395. Procedure CHOOSE_PAGE
  396.    Screen 0 : Cls 0 : Clear Key : Pen 1
  397.    Input "Please enter page number to access:";A
  398.    Curs Off 
  399.    If A<1 or A>PAGE_NUM
  400.       Print "No such page."; : Wait 45
  401.       Cls 0 : Home 
  402.       Print ITEM$(POSITION2-9);
  403.       X$="Page"+Str$(NUM+1)+" of"+Str$(PAGE_NUM)
  404.       Locate 79-Len(X$),0 : Print X$;
  405.       Screen 1
  406.       Pop Proc
  407.    End If 
  408.    PAGE_SHOW[A-1]
  409.    CURRENT_PAGE=A-1
  410.    Screen 1
  411. End Proc
  412. ' -----------------------------------------------------------------------
  413. Procedure CHOOSE_INDEX
  414.    Screen 0 : Cls 0 : Clear Key : Pen 1
  415.    Input "Please enter page number to access:";A
  416.    Curs Off 
  417.    If A<1 or A>NO_INDEX
  418.       Print "No such page."; : Wait 45
  419.       Cls 0 : Home 
  420.       Print "Index";
  421.       X$="Page"+Str$(CUR_INDEX+1)+" of"+Str$(NO_INDEX)
  422.       Locate 79-Len(X$),0 : Print X$;
  423.       Screen 1
  424.       Pop Proc
  425.    End If 
  426.    CUR_INDEX=A-1
  427.    SET_UP_INDEX
  428.    Screen 1
  429. End Proc
  430. ' -----------------------------------------------------------------------
  431. Procedure MAKE_INDEX
  432.    ' Be sure to understand this first!  It loads in the index file and
  433.    ' processes it, writing the user text into relevant strings. 
  434.    ' Be careful!
  435.    '
  436.    Open In 1,"magnum.index"
  437.    Z=0
  438.    For I=0 To 3
  439.       Repeat 
  440.          X$=Input$(1,1)
  441.          If Asc(X$)=10 Then Exit 
  442.          RGB$(I)=RGB$(I)+X$
  443.       Until Eof(1)=-1
  444.    Next I
  445.    Repeat 
  446.       X$=Input$(1,1)
  447.       If Asc(X$)=10 Then Exit 
  448.       TITLE$=TITLE$+X$
  449.    Until Eof(1)=-1
  450.    '************************
  451.    Repeat 
  452.       Repeat 
  453.          X$=Input$(1,1)
  454.          If Asc(X$)=10 Then Exit 
  455.          ITEM$(Z)=ITEM$(Z)+X$
  456.       Until Eof(1)=-1
  457.       Repeat 
  458.          If Left$(ITEM$(Z),7)="*empty*" Then BOOT$(Z)="*empty*" : Exit 
  459.          X$=Input$(1,1)
  460.          If Asc(X$)=10 Then Exit 
  461.          BOOT$(Z)=BOOT$(Z)+X$
  462.       Until Eof(1)=-1
  463.       Inc ZAP
  464.       If ZAP=21 Then ZAP=0 : Inc NO_INDEX
  465.       Inc Z
  466.       If Z=200 Then Exit 
  467.    Until Lof(1)-Pof(1)<2
  468.    Close 1
  469.    INDXL=Z
  470. End Proc
  471. ' -----------------------------------------------------------------------
  472. Procedure FILE_PROCESS
  473.    CUR_PEN=1
  474.    '  ^-------------------------------- PEN COLOUR RESET
  475.    '
  476.    ' I pinched some of these bits from the _old_ ASCII reader in the AMOS 
  477.    ' package.  I was going to do my own then I noticed everyone was using 
  478.    ' _this_ same routine so why not join the band wagon eh? 
  479.    '
  480.    PAGE_NUM=0
  481.    LINES=-1
  482.    TEMP=0
  483.    COUNT=0
  484.    '   CONVERT
  485.    ST=Start(10)
  486.    EN=Start(10)+FILE_LENGTH
  487.    COUNT=ST
  488.    Repeat 
  489.       If PAGE_NUM=0
  490.          PAGESTART(PAGE_NUM)=ST
  491.       Else 
  492.          PAGESTART(PAGE_NUM)=COUNT+1
  493.       End If 
  494.       LINES=0
  495.       Repeat 
  496.          Inc LINES
  497.          Inc COUNT
  498.          TEMP=False
  499.          Repeat 
  500.             A=Hunt(COUNT To EN,Chr$(10))
  501.             If(A-COUNT>79) or A=0
  502.                Add COUNT,79
  503.                TEMP=True
  504.             Else 
  505.                COUNT=A
  506.             End If 
  507.          Until COUNT=>EN or A<>0 or TEMP=True
  508.       Until LINES=PAGE_LENGTH or COUNT=>EN
  509.       PAGEEND(PAGE_NUM)=COUNT
  510.       Inc PAGE_NUM
  511.    Until COUNT=>EN or PAGE_NUM=200
  512.    PAGEEND(PAGE_NUM-1)=EN
  513.    '------------------------------------------- cols
  514.    For ZQ=0 To PAGE_NUM-1
  515.       C_ST=PAGESTART(ZQ) : C_EN=PAGEEND(ZQ)
  516.       Do 
  517.          A=Hunt(C_ST To C_EN,"@")
  518.          If A
  519.             B=A
  520.             A=Peek(B+1)
  521.             If A>=49 and A<=55
  522.                PAGE_PEN(ZQ)=A-48
  523.                CRAPPY=True
  524.             End If 
  525.             C_ST=B+1
  526.          Else 
  527.             If CRAPPY=False
  528.                PAGE_PEN(ZQ)=1
  529.             End If 
  530.             Exit 
  531.          End If 
  532.       Loop 
  533.       CRAPPY=False
  534.    Next ZQ
  535.    '------------------------------------------- end cols  
  536.    Screen 0
  537.    Cls 0 : Home 
  538.    Print ITEM$(POSITION2-9);
  539.    PAGE_SHOW[0]
  540.    CURRENT_PAGE=0
  541.    Screen 1
  542. End Proc
  543. ' -----------------------------------------------------------------------
  544. Procedure PAGE_SHOW[NUM]
  545.    Screen 2
  546.    If TXTFADE=-1
  547.       Fade 1,0,0,0,0,0,0,0,0
  548.       Wait 15
  549.    Else 
  550.       Palette 0,0,0,0,0,0,0
  551.    End If 
  552.    Cls 0
  553.    '----------------------------------------------- finds text col
  554.    If NUM=0 Then CUR_PEN=1 Else CUR_PEN=PAGE_PEN(NUM-1)
  555.    Pen CUR_PEN
  556.    '
  557.    Home 
  558.    Inverse Off 
  559.    For I=PAGESTART(NUM) To PAGEEND(NUM)
  560.       A=Peek(I)
  561.       If Chr$(A)="@"
  562.          A=Peek(I+1)
  563.          If A>=49 and A<=55
  564.             Pen A-48 : CUR_PEN=A-48 : Inc I
  565.          Else 
  566.             If A=102
  567.                TXTFADE=-1 : Inc I
  568.             Else 
  569.                Print "@";
  570.             End If 
  571.          End If 
  572.       Else 
  573.          Print Chr$(A);
  574.          If A=10
  575.             Print Chr$(13);
  576.          End If 
  577.       End If 
  578.    Next I
  579.    If TXTFADE=-1
  580.       Fade 1,0,$EEE,$C00,$CC0,$C0,$CC,$C,$C0C
  581.       Wait 15
  582.    Else 
  583.       Palette 0,$EEE,$C00,$CC0,$C0,$CC,$C,$C0C
  584.    End If 
  585.    Screen 0
  586.    Cls 0 : Home 
  587.    Print ITEM$(POSITION2-9);
  588.    X$="Page"+Str$(NUM+1)+" of"+Str$(PAGE_NUM)
  589.    Locate 79-Len(X$),0 : Print X$;
  590.    Screen 1
  591.    CURRENT_PAGE=NUM
  592. End Proc
  593.